// 原材料出库查询 -- wzhg
import React, { Component } from 'react'
import {ListBox} from '../../../components'
import { Modal } from 'antd';

export default class ListProScrapOutSnPage extends Component{
    constructor(props) {
        super(props);
        //行操作列表-已弃用
        this.rowOperation = [
            
        ];
        //header 操作列表111
        this.headerOperation = [
            // {
            //     handleName: 'add',
            //     showName: '新增',
            //     iconClass: 'plus'
            // }
        ];

        //table列表展示列配置
        //showName、columnName 必有属性， columnWidth 可选，默认100, columnHidden: true 列隐藏
        // foreverHidden永久隐藏
        this.tableColumn = {
            storageKey: 'id',
            data: [
                {
                    showName: 'id',
                    columnName: 'ScrapOutId',
                    columnHidden:true,
                    foreverHidden: true
                },
                {
                    showName: '报废出库单号',
                    columnName: 'ScrapOutNo'
                },
                {
                    showName: '合同编号',
                    columnName: 'contractNo'
                },
                {
                    showName: '条码',
                    columnName: 'barcode',
                    columnWidth: 80
                },
                {
                    showName: '型号',
                    columnName: 'model'
                },
                {
                    showName: '型号描述',
                    columnName: 'modelDesc',
                    columnWidth: 150
                },
                {
                    showName: '型号类型',
                    columnName: 'modelType'
                },
                {
                    showName: '类型',
                    columnName: 'type'
                },
                {
                    showName: '单位',
                    columnName: 'unit',
                    columnWidth: 80
                },
                {
                    showName: '数量',
                    columnName: 'amount',
                    columnWidth: 80
                },
                {
                    showName: '库位',
                    columnName: 'wlCode',
                    columnWidth: 80
                }
            ]
        };

        //搜索属性配置，如果字段不配置，默认是input搜索
        // 搜索类型：
        //      1、输入框 type='input'， 默认
        //      2、时间 type='date'
        //      3、数字 type='number'
        //      4、下拉框 type='select'
        this.searchComponentData = [
            {
                showName: '数量',
                name:'amount',
                type: 'number',
                maxName:'amountMax', //最大值
                minName:'amountMin'  //最小值
            }
        ];

    }

    // 行操作
    rowHandles = (strHandles, rowObj) => {
        // if(strHandles === 'edit'){
        //     this.editHandle(rowObj);
        // }else if(strHandles === 'delete'){
        //     this.deleteHandle(rowObj);
        // }else if(strHandles === 'add'){
        //     this.addHandle();
        // }
    }


    //刷新列表
    refreshHandle = () => {
        this.refs.proScrapOutSnList.refreshHandle();
    }

    render() {
        //当左侧隐藏时，列表宽度加上左侧的宽度，
        //1、当前this.props.isHideLeft 是从页面组件containers/Main/main.js传过来
        //2、this.props.isHideLeft 最顶级赋值是在页面 containers/Main/main.js
        let isHideLeft = this.props.isHideLeft;

        return(
            <div>
                <ListBox
                    ref = 'proScrapOutSnList'
                    title="手工出库明细查询"
                    isHideLeft={isHideLeft}
                    tableColumnData = {this.tableColumn}
                    searchComponentData={this.searchComponentData}
                    url = '/product/proscrapoutsn/list'
                    rowHandles = {this.rowHandles}
                    rowOperation = {this.rowOperation}
                    headerOperation = {this.headerOperation}
                    isRowSingle = "true"
                />
            </div>
        )
        
    }

}